<ui:composition template="/admin/templates/ui2.xhtml"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:composite="http://java.sun.com/jsf/composite/primefaces"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui"
    xmlns:fn="http://java.sun.com/jsp/jstl/functions"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:sec="http://www.springframework.org/security/facelets/tags">

    <ui:define name="content">
    
    <div class="entry">
    	<p:toolbar>
            <p:toolbarGroup>
	            <h:outputLabel style="padding-left: 15px;" value="#{commonMsg.currentPositionLabel}员工考勤"></h:outputLabel>
            </p:toolbarGroup>
            <p:toolbarGroup align="right">
	           <p:toolbarGroup align="right">
					<p:button value="考勤统计" outcome="/admin/checktime/EmployeesCheckCount"></p:button>
				</p:toolbarGroup>
            </p:toolbarGroup>
            <p:toolbarGroup align="right">
	           <p:toolbarGroup align="right">
					<p:button value="考勤记录导入" outcome="/admin/checktime/EmpCheckImport"></p:button>
				</p:toolbarGroup>
            </p:toolbarGroup>
        </p:toolbar>
        
        <h:form id="form" enctype="multipart/form-data"> 
        	<p:spacer></p:spacer> 
        		<p:panel id="filters">
        			
						<h:panelGrid columns="8" 
						rowClasses="filter-row" columnClasses="filter-col1,filter-col2">
						<h:outputLabel value="员工姓名："></h:outputLabel>
						<p:inputText id="jobnameyqqy" value="#{fileUploadExcel.example.jobname}"></p:inputText>
                    	<h:outputLabel value="员工工号："></h:outputLabel>
                    	<p:inputText id="jobnumyyq" value="#{fileUploadExcel.example.jobnum}"></p:inputText>
                    
                    <ui:fragment></ui:fragment>
                    <ui:fragment></ui:fragment>
                    <ui:fragment></ui:fragment>
                    <ui:fragment></ui:fragment>
                    <h:outputLabel value="考勤日期："></h:outputLabel>
                    
                    <ui:fragment>
					 <h:selectOneMenu value="#{fileUploadExcel.checkYear}">
                    	<f:selectItem itemLabel="请选择年份" itemValue=""></f:selectItem>
                    	<f:selectItems var="year" value="#{empCheckUtil.getYears()}" itemLabel="#{year}" itemValue="#{year}"></f:selectItems>
                    </h:selectOneMenu>
                    <h:outputLabel value="年"></h:outputLabel>
                     <h:selectOneMenu value="#{fileUploadExcel.checkMonth}">
                    	<f:selectItem itemLabel="请选择月份" itemValue=""></f:selectItem>
                    	<f:selectItems var="year" value="#{empCheckUtil.getMonths()}" itemLabel="#{year}" itemValue="#{year}"></f:selectItems>
                    </h:selectOneMenu>
                    
                    <h:outputLabel value="月"></h:outputLabel>
                    </ui:fragment>
                    <h:outputLabel value="操作："></h:outputLabel>
                    <ui:fragment>
                    <p:commandButton update="dataTable" process="filters"
                        value="#{commonMsg.searchLabel}"></p:commandButton>
                    <p:button value="#{commonMsg.resetLabel}" onclick="location.reload();return;"></p:button>
                    
						</ui:fragment>
						<ui:fragment></ui:fragment>
						<ui:fragment></ui:fragment>
						<ui:fragment></ui:fragment>
						<ui:fragment></ui:fragment>
					</h:panelGrid>
        		
        		</p:panel>
                
                   
            <p:spacer></p:spacer> 
            <p:dataTable lazy="true" id="dataTable" value="#{fileUploadExcel.lazyModel}" var="eci" 
                paginator="true" paginatorPosition="bottom" rows="50" rowsPerPageTemplate="15,50,100"
                rowKey="#{eci.id}" sortBy="eci.jobnum"
                currentPageReportTemplate="#{commonMsg.pageReportTemplate}"
                paginatorTemplate="#{commonMsg.paginatorTemplate}"
                emptyMessage="#{commonMsg.noResultMsg}" selection="#{userList.selectedUsers}">
                
                <!-- <p:column selectionMode="multiple" style="width:18px" exportable="false"/>  -->
<!--                  <p:column sortBy="user.id"> -->
<!--                 	<f:facet name="header"> -->
<!--                 		<h:outputText value="#{commonMsg.IDLabel}"></h:outputText> -->
<!--                 	</f:facet> -->
<!--                     <h:outputText  value="#{user.id}"></h:outputText> -->
<!--                 </p:column>      -->
                <p:column sortBy="to_number(eci.jobnum)">
                	<f:facet name="header">
                		<h:outputText value="员工工号"></h:outputText>
                	</f:facet>
                    <h:outputText  value="#{eci.jobnum}"></h:outputText>
                </p:column>  
                <p:column sortBy="eci.check_day">
                	<f:facet name="header">
                		<h:outputText value="日期"></h:outputText>
                	</f:facet>
                    <h:outputText  value="#{eci.check_year}-#{eci.check_month}-#{eci.check_day}"></h:outputText>
                </p:column>
                  
                <p:column sortBy="eci.jobname">
                	<f:facet name="header">
                		<h:outputText value="名字"></h:outputText>
                	</f:facet>
                    <h:outputText  value="#{eci.jobname}"></h:outputText>
                </p:column>
                
                <p:column>
                	<f:facet name="header">
                		<h:outputText value="部门"></h:outputText>
                	</f:facet>
                    <h:outputText  value="#{eci.department}"></h:outputText>
                </p:column>               
                <p:column>
                	<f:facet name="header">
                		<h:outputText value="上班打卡时间"></h:outputText>
                	</f:facet>
                    <h:outputText  value="#{eci.mintime}"></h:outputText>
                </p:column>               
                <p:column>
                	<f:facet name="header">
                		<h:outputText value="下班打卡时间"></h:outputText>
                	</f:facet>
                    <h:outputText  value="#{eci.maxtime}"></h:outputText>
                </p:column>   
                 <p:column style="#{eci.checkstatus ne '正常打卡。' and eci.checkstatus ne '休息日'?'text-align:left;color:red;':'text-align:center;'}">
                	<f:facet name="header">
                		<h:outputText value="打卡的状态"></h:outputText>
                	</f:facet>
                    <h:outputText value="#{eci.checkstatus}"/>
                </p:column>      
<!--                 <p:column> -->
<!--                 	<f:facet name="header"> -->
<!--                 		<h:outputText value="打卡的状态说明"></h:outputText> -->
<!--                 	</f:facet> -->
<!--                     <h:outputText value="#{eci.statusinstruction}"/> -->
<!--                 </p:column>               -->
                <p:column>
                	<f:facet name="header">
                		<h:outputText value="加班"></h:outputText>
                	</f:facet>
                    <h:outputText  value="#{eci.workovertime}"></h:outputText>
                </p:column>  
                <p:column>
                	<f:facet name="header">
                		<h:outputText value="加班说明"></h:outputText>
                	</f:facet>
                    <h:outputText  value="#{eci.workovertimeinstruction}"></h:outputText>
                </p:column>  
               
                 <f:facet name="footer"> 		           		            
					<p:commandButton value="导出Excel" ajax="false">
						<p:dataExporter target="dataTable" type="xls" fileName="empCheckInfo" pageOnly="false"></p:dataExporter>
					</p:commandButton>
 		        </f:facet> 
            </p:dataTable>
           
           
        
            </h:form>
      </div>
    </ui:define> 
</ui:composition>
